package com.openlab.homeAdapter;

import java.util.ArrayList;
import java.util.Map;

import com.openlab.activity.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class PostListAdapter extends BaseAdapter{

		private Context context;
		private int itemId = 0;
		private ArrayList<Map<String, Object>> list;
		private String[] data = new String[20];
		
		private int[] buttonId = {R.id.button0,R.id.button1,R.id.button2,R.id.button3,R.id.button4};
		
		public PostListAdapter(Context context, int Id, ArrayList<Map<String, Object>> list){
			this.context = context;
			this.list = list;			
			itemId = Id;
		}
		
		public void setList(int Id, ArrayList<Map<String, Object>> list){
			itemId = Id;
			this.list = list;
		}
		
		public void dispatchData(){
			
		}
		
		@Override
		public int getCount() {
			return data.length;
		}

		@Override
		public Object getItem(int position) {
			return data[position];
		}

		@Override
		public long getItemId(int position) {
			return position;
		}
		
		@Override
		public View getView(int position, View convertView, ViewGroup parent) {  
			if(convertView == null){
				convertView = LayoutInflater.from(context).inflate(R.layout.home_hotlist, null);   
			}
			String str = list.get(position).get("name").toString();

			TextView postName = (TextView)convertView.findViewById(R.id.hotText);
			postName.setText(str);
			

//			ImageView shiftImage = (ImageView)convertView.findViewById(R.id.itemmove);
//			shiftImage.setImageResource(R.drawable.button2_over);
//			shiftImage.setClickable(false);
//			Artistsitem.setImageResource(R.drawable.artist);
			return convertView;
		}

	}
